package cn.biplam.front.component.view.systemManage.sysprivi.role;

import cn.biplam.common.ajxcode.SystemCode.RoleManageCode;
import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.front.component.AjxResponse;
import cn.biplam.front.component.view.systemManage.sysprivi.role.manage.RoleManageMain;
import cn.biplam.front.component.view.systemManage.sysprivi.role.manage.del.DelRole;
import cn.biplam.front.component.view.systemManage.sysprivi.role.manage.privi.AddRolePrivi;
import cn.biplam.front.component.view.systemManage.sysprivi.role.manage.privi.DelRolePrivi;
import cn.biplam.front.component.view.systemManage.sysprivi.role.manage.privi.RolePriviMain;
import cn.biplam.front.html.base.HtmlWindow;

/**
 *  角色管理
 * @author XiaoRuxing Nov 2, 20093:31:23 PM
 * @version 1.0
 */
public class RoleManage extends AjxResponse{

	public static final String cId=RoleManageCode.cId;

	/** 角色管理主界面*/
	public static final String Main= RoleManageCode.Main;
	/** 角色删除 */
	public static final String Role_Del = RoleManageCode.Role_Del;
	/** 删除角色提交 */
	public static final String Role_Del_Submit = RoleManageCode.Role_Del_Submit;
	/** 角色目录删除 */
	public static final String Role_Dir_Del = RoleManageCode.Role_Dir_Del;
	/** 删除角色目录提交 */
	public static final String Role_Dir_Del_Submit = RoleManageCode.Role_Dir_Del_Submit;
	/** 角色信息显示界面 */
	public static final String Role_Info = RoleManageCode.Role_Info;
	/** 创建角色权限 */
	public static final String Role_Privi_Add  = RoleManageCode.Role_Privi_Add;
	/** 创建角色权限提交 */
	public static final String Role_Privi_Add_Submit = RoleManageCode.Role_Privi_Add_Submit;
	/** 删除角色权限提示界面 */
	public static final String Role_Privi_Del = RoleManageCode.Role_Privi_Del;
	/** 删除角色权限提交 */
	public static final String Role_Privi_Del_Submit = RoleManageCode.Role_Privi_Del_Submit;

	@Override
	protected HtmlWindow ajxGet() throws ErrorMessage {
		if(this.actionId.equals(RoleManage.Main)){
			return new RoleManageMain(mUser,sHomeUrl,recordId,params).get();
		//删除角色	
		}else if(this.actionId.equals(RoleManage.Role_Del)){
			return new DelRole(mUser,sHomeUrl,recordId,params).panel();
		}else if(this.actionId.equals(RoleManage.Role_Del_Submit)){
			return new DelRole(mUser,sHomeUrl,recordId,params).submit();
		//删除角色目录	
		}else if(this.actionId.equals(RoleManage.Role_Dir_Del)){
			return new DelRole(mUser,sHomeUrl,recordId,params).delRoleTheme();
		}else if(this.actionId.equals(RoleManage.Role_Dir_Del_Submit)){
			return new DelRole(mUser,sHomeUrl,recordId,params).themeSubmit();
		//角色信息显示主页面	
		}else if(this.actionId.equals(RoleManage.Role_Info)){
			return new RolePriviMain(mUser,sHomeUrl,recordId,params).get();
		//添加角色权限	
		}else if(this.actionId.equals(RoleManage.Role_Privi_Add)){
			return new AddRolePrivi(mUser,sHomeUrl,recordId,params).priviSelect();
		}else if(this.actionId.equals(RoleManage.Role_Privi_Add_Submit)){
			return new AddRolePrivi(mUser,sHomeUrl,recordId,params).submit();
		//删除角色权限	
		}else if(this.actionId.equals(RoleManage.Role_Privi_Del)){
			return new DelRolePrivi(mUser,sHomeUrl,recordId,params).get();
		}else if(this.actionId.equals(RoleManage.Role_Privi_Del_Submit)){
			return new DelRolePrivi(mUser,sHomeUrl,recordId,params).submit();
		}else{
			throw new ErrorMessage("Ajx Exchange outport not found:" + actionId	+ " !");
		}
	}

}
